<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <head th:replace="common/head"/>
</head>
<body>
<div class="x-body">
    <form class="layui-form" style="padding-bottom: 10px;text-align: left;">
        图片名称：
        <div class="layui-inline">
            <input class="layui-input" type="text" name="name" autocomplete="on" placeholder="图片名称">
        </div>
        <button class="layui-btn" lay-submit lay-filter="search"><i class="layui-icon">&#xe615;</i></button>
    </form>

    <xblock>
        <button class="layui-btn layui-btn-normal dialog" data-url="/customerImg/toAdd" data-title="添加">
            <i class="layui-icon">&#xe608;</i>添加
        </button>
    </xblock>

    <input type="hidden" id="editText" value="CustomerImg/editText">
    <input type="hidden" id="myEntityId" value="id">

    <table class="layui-table"
           lay-data="{url:'/customerImg/list', page:true,id:'table',limit:15,limits:[10,15,20,50,100]}"
           lay-filter="table">
        <thead>
        <tr>
            <th lay-data="{field:'name',align:'center'}">图片名</th>
            <th lay-data="{field:'url',align:'center'}">地址</th>
            <th lay-data="{field:'url',align:'center',templet:'#img'}">预览</th>
            <th lay-data="{fixed:'right', align:'center',width:200, toolbar: '#row-bar'}">操作</th>
        </tr>
        </thead>
    </table>

    <script type="text/html" id="img">
        {{#  if(d.url != '' && d.url != null){ }}
        <img src="{{d.url}}" alt="{{d.name}}">
        {{#  } }}
    </script>

    <script type="text/html" id="row-bar">
        <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="edit" data-url="/customerImg/toEdit" data-title="编辑"
         data-id="id" data-width="800" data-height="600"><i class="layui-icon">&#xe642;</i> 编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" data-url="/customerImg/delete"><i
                class="layui-icon">&#xe640;</i> 删除</a>
    </script>
</div>
<div th:replace="common/js"></div>
<div th:replace="common/setting"></div>
<script type="text/javascript">
    layui.use('xtable');
</script>
</body>
</html>
